<?php

	if (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
		die ('Please do not load this page directly. Thanks!');

	if ( post_password_required() ) { ?>
		<?php _e('The comments is password protected. Enter your password.', 'themeText'); ?>
	<?php
		return;
	}
?>

<?php if ( have_comments() ) : ?>
	<a name="comments"></a>
	<h1><?php comments_number(__(' No Comments', 'themeText'), __(' 1 Comment', 'themeText'), __( ' % Comments', 'themeText') )?></h1>

	<ul class="commentlist pull-right">
		<?php wp_list_comments( array( 'callback' => 'theme_comments' ) ); ?>
	</ul>

    <div class="navigation group">
        <div class="prev-posts"><?php previous_comments_link('&larr;'); ?></div>
        <div class="next-posts"><?php next_comments_link('&rarr;'); ?></div>
	</div>
	
 <?php else : // this is displayed if there are no comments so far ?>

	<?php if ( comments_open() ) : ?>
		<!-- If comments are open, but there are no comments. -->

	 <?php else : // comments are closed ?>
		<p>Comments are closed.</p>

	<?php endif; ?>
	
<?php endif; ?>                     
                        
 <?php
 add_filter('comment_form_defaults', 'rapid_comment_form');

function rapid_comment_form($form_options)
{

    // Fields Array
    $fields = array(

        'author' =>
        '<!--[if IE]><label for="name">' . __('Name:', 'themeText') . '</label><![endif]-->' .
        '<input style="margin-right:25px;" class="span2" id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" ' . $aria_req . ' placeholder="' . __( 'Name', 'themeText') . '" />' .
        '',

        'email' =>
        '<!--[if IE]><label for="name">' . __('Email:', 'themeText') . '</label><![endif]-->' .
        '<input style="margin-right:25px;" class="span2" id="email" name="email" type="text" value="' . esc_attr( $commenter['comment_author_email'] ) . '" ' . $aria_req . ' placeholder="' . __( 'Email:', 'themeText') . '" />' .
        '',

        'url' =>
        '<!--[if IE]><label for="name">' . __( 'Your Website (optional):', 'themeText' ) . '</label><![endif]-->'  .
        '<input class="span2" name="url" id="url" value="' . esc_attr( $commenter['comment_author_url'] ) . '" type="text" placeholder="' . __( 'Your Website (optional):', 'themeText' ) . '" />' .
        '',

    );

    // Form Options Array
    $form_options = array(
        // Include Fields Array
        'fields' => apply_filters( 'comment_form_default_fields', $fields ),

        // Template Options
        'comment_field' =>
        '<!--[if IE]><label for="name">' . __( 'Your Comment...', 'themeText' ) . '</label><![endif]-->' .
        '<textarea name="comment" id="comment" aria-required="true" rows="5" class="span6" tabindex="4" placeholder="' . __( 'Your Comment...', 'themeText' ) . '"></textarea>' .
        '',

        'must_log_in' =>
        '<p class="must-log-in">' .
        sprintf( __( 'You must be <a href="%s">logged in</a> to post a comment.', 'themeText'  ),
            wp_login_url( apply_filters( 'the_permalink', get_permalink($post_id) ) ) ) .
        '</p>',

        'logged_in_as' =>
        '<p>' .
        sprintf( __( 'Logged in as <a href="%1$s">%2$s</a>. <a href="%3$s" title="Log out of this account">Log out?</a>', 'themeText'  ),
            admin_url('profile.php'), $user_identity, wp_logout_url( apply_filters('the_permalink', get_permalink($post_id)) ) ) .
        '</p>',

        'comment_notes_before' => '<p>' . __( 'Please keep in mind that comments are moderated and <code>rel="nofollow"</code> is in use. So, please do not use a spammy keyword or a domain as your name, or it will be deleted. Let us have a personal and meaningful conversation instead.', 'themeText' ) . '</p>',

        'comment_notes_after' => '',

        // Rest of Options
        'id_form' => 'commentform',
        'id_submit' => 'submit',
        'title_reply' => __( 'Leave a Comment', 'themeText'  ),
        'title_reply_to' => __( 'Leave a Reply to %s', 'themeText'  ),
        'cancel_reply_link' => __( 'Cancel reply', 'themeText'  ),
        'label_submit' => __( 'Post Your Comment', 'themeText'  ),
    );

    return $form_options;
}
comment_form($fields);
?>